package org.seedltd.upms.service.impl.detection;

import org.seedltd.core.base.BaseServiceImpl;
import org.seedltd.upms.mapper.detection.DetectionOrderRefundMapper;
import org.seedltd.upms.model.detection.entity.DetectionOrderRefund;
import org.seedltd.upms.model.detection.vo.DetectionOrderRefundVO;
import org.seedltd.upms.service.detection.DetectionOrderRefundService;
import org.springframework.stereotype.Service;

import lombok.AllArgsConstructor;

/**
 * 订单退款信息业务实现
 * 
 * @author laizuan
 * @since 2021/07/31
 */
@Service
@AllArgsConstructor
public class DetectionOrderRefundServiceImpl extends BaseServiceImpl<DetectionOrderRefundMapper, DetectionOrderRefund>
    implements DetectionOrderRefundService {

    @Override
    public DetectionOrderRefundVO findByOrderId(Long orderId) {
        return q().eq(DetectionOrderRefund::getOrderId, orderId).selectOne(DetectionOrderRefundVO.class);
    }

    @Override
    public DetectionOrderRefund getByOrderId(Long orderId) {
        return q().eq(DetectionOrderRefund::getOrderId, orderId).selectOne();
    }

    @Override
    public DetectionOrderRefund findByRefundOutId(String refundNo) {
        return q().eq(DetectionOrderRefund::getRefundNo, refundNo).selectOne();
    }
}